
package data;

import java.sql.*;
import java.util.*;
import utils.Transacao;



public class UserData {

  public UserDo buscar(int Login, Transacao tr) throws Exception {
     Connection con = tr.obterConexao();
     String sql = "select * from PacienteOcupaSala where  Login=?";
     PreparedStatement ps = con.prepareStatement(sql);
     ps.setInt(1, Login);
     ResultSet rs = ps.executeQuery();
     rs.next();
     UserDo User = new UserDo();
     User.setidUser (rs.getInt("idUser"));
     User.setLogin (rs.getString("idUser"));
     User.setPassword (rs.getString("idUser"));
     User.setPaciente (rs.getInt("idUser"));
     User.setFuncionario (rs.getInt("idUser"));
     return User;
  } 
    
    
    
    
    
    
}
